<template>
  <div>
    <el-table
      :data="noticeData"
      border
      fit
      highlight-current-row
      style="width: 100%"
    >
      <el-table-column
        align="center"
        sortable="custom"
        :prop="noticeData.createdTime"
        :label="noticeRemark.createdTime"
        width="200"
      >
        <template slot-scope="scope">
          <i class="el-icon-time" />
          <span>{{ scope.row.createdTime }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="topic" :label="noticeRemark.topic" width="160">
      </el-table-column>
      <el-table-column prop="content" :label="noticeRemark.content" width="700">
      </el-table-column>
      <el-table-column
        :label="noticeRemark.operation"
        align="center"
        min-width="150"
        class-name="fixed-width"
      >
        <template #default="{ row }">
          <!-- <el-button type="primary" size="mini" @click="handleSeekInfo()">
            {{ noticeRemark.seek }}
          </el-button> -->
          <el-button size="mini" type="danger" @click="handleSeekInfo()">
            {{ noticeRemark.danger }}
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      :total="noticeRemark.total"
      v-show="noticeRemark.total > 0"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="noticeRemark.currentPage"
      :page-sizes="[10, 20, 50, 100]"
      layout="total, sizes, prev, pager, next, jumper"
    />
  </div>
</template>

<script>
export default {
  created() {
    this.getData();
  },
  data() {
    return {
      noticeRemark: {
        id: "序号",
        topic: '主题',
        content: '内容',
        createdTime: '发布时间',
        operation: "操作",
        seek: "查看信息",
        edit: "编辑",
        danger: "删除",
        total: "10",
        currentPage: "1",
      },
      noticeData: [],
    };
  },
  methods: {
    getData() {
      this.$store.dispatch("request/get", "/basic/notice/query").then((data) => {
        this.noticeData = data;
      });
    },
  },
};
</script>

<style>
</style>